package cemp.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @TableName stock_avg
 */
@Data
@TableName(value ="stock_avg")
public class StockAvg implements Serializable {
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    private String stockCode;

    private BigDecimal avgTen;

    private BigDecimal avgTwenty;

    private BigDecimal avgThirty;

    private BigDecimal avgSixty;

    private BigDecimal avgHuntwenty;

    private Date staDate;

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getStockCode() {
        return stockCode;
    }

    public void setStockCode(String stockCode) {
        this.stockCode = stockCode;
    }

    public BigDecimal getAvgTen() {
        return avgTen;
    }

    public void setAvgTen(BigDecimal avgTen) {
        this.avgTen = avgTen;
    }

    public BigDecimal getAvgTwenty() {
        return avgTwenty;
    }

    public void setAvgTwenty(BigDecimal avgTwenty) {
        this.avgTwenty = avgTwenty;
    }

    public BigDecimal getAvgThirty() {
        return avgThirty;
    }

    public void setAvgThirty(BigDecimal avgThirty) {
        this.avgThirty = avgThirty;
    }

    public BigDecimal getAvgSixty() {
        return avgSixty;
    }

    public void setAvgSixty(BigDecimal avgSixty) {
        this.avgSixty = avgSixty;
    }

    public BigDecimal getAvgHuntwenty() {
        return avgHuntwenty;
    }

    public void setAvgHuntwenty(BigDecimal avgHuntwenty) {
        this.avgHuntwenty = avgHuntwenty;
    }

    public Date getStaDate() {
        return staDate;
    }

    public void setStaDate(Date staDate) {
        this.staDate = staDate;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        StockAvg other = (StockAvg) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStockCode() == null ? other.getStockCode() == null : this.getStockCode().equals(other.getStockCode()))
            && (this.getAvgTen() == null ? other.getAvgTen() == null : this.getAvgTen().equals(other.getAvgTen()))
            && (this.getAvgTwenty() == null ? other.getAvgTwenty() == null : this.getAvgTwenty().equals(other.getAvgTwenty()))
            && (this.getAvgThirty() == null ? other.getAvgThirty() == null : this.getAvgThirty().equals(other.getAvgThirty()))
            && (this.getAvgSixty() == null ? other.getAvgSixty() == null : this.getAvgSixty().equals(other.getAvgSixty()))
            && (this.getAvgHuntwenty() == null ? other.getAvgHuntwenty() == null : this.getAvgHuntwenty().equals(other.getAvgHuntwenty()))
            && (this.getStaDate() == null ? other.getStaDate() == null : this.getStaDate().equals(other.getStaDate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStockCode() == null) ? 0 : getStockCode().hashCode());
        result = prime * result + ((getAvgTen() == null) ? 0 : getAvgTen().hashCode());
        result = prime * result + ((getAvgTwenty() == null) ? 0 : getAvgTwenty().hashCode());
        result = prime * result + ((getAvgThirty() == null) ? 0 : getAvgThirty().hashCode());
        result = prime * result + ((getAvgSixty() == null) ? 0 : getAvgSixty().hashCode());
        result = prime * result + ((getAvgHuntwenty() == null) ? 0 : getAvgHuntwenty().hashCode());
        result = prime * result + ((getStaDate() == null) ? 0 : getStaDate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", stockCode=").append(stockCode);
        sb.append(", avgTen=").append(avgTen);
        sb.append(", avgTwenty=").append(avgTwenty);
        sb.append(", avgThirty=").append(avgThirty);
        sb.append(", avgSixty=").append(avgSixty);
        sb.append(", avgHuntwenty=").append(avgHuntwenty);
        sb.append(", staDate=").append(staDate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
